package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.ReimburseDto;
import xyz.zhouzhaodong.crm.entity.Reimburse;
import xyz.zhouzhaodong.crm.service.IReimburseService;
import xyz.zhouzhaodong.crm.service.IReimburseService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 报销 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-06-21
 */
@RestController
@RequestMapping("/reimburse")
public class ReimburseController {
    
    @Resource
    IReimburseService reimburseService;

    /**
     * 新增报销
     * @param reimburse
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addReimburse(Reimburse reimburse){
        return reimburseService.addReimburse(reimburse);
    }

    /**
     * 删除报销
     * @param reimburse
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteReimburse(Reimburse reimburse){
        return reimburseService.deleteReimburse(reimburse);
    }

    /**
     * 修改报销
     * @param reimburse
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateReimburse(Reimburse reimburse){
        return reimburseService.updateReimburse(reimburse);
    }

    /**
     * 查询报销
     * @param reimburseDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectReimburse(ReimburseDto reimburseDto){
        return reimburseService.selectReimburse(reimburseDto);
    }
}
